import request from '../request'

const Api = {
  page: '/api/adminschool/school/page',
  remove: '/api/adminschool/school/remove',
  removeBatch: '/api/adminschool/school/removeBatch',
  save: '/api/adminschool/school/save',
  selectById: '/api/adminschool/school/selectById',
  update: '/api/adminschool/school/update',
  getSchoolEnName: '/api/adminschool/school/getSchoolEnName',
  country: '/api/admincountry_province_state/tree',
  updateUser: '/api/adminschool/school/updateBatchResponsiblePerson',

  imports: '/api/admincollege/down/template/collegeImport',
  template: '/api/admincollege/down/template/collegeInfo',
  // 跟进记录
  updateFollowUpRecord: '/api/adminschool/school/updateFollowUpRecord',
  delFollowUpRecord: '/api/adminschool/school/delFollowUpRecord',
}

/** 删除学校信息 */
export const remove = params => {
  return request.request({
    url: Api.remove,
    params,
    method: 'DELETE'
  })
}
/** 批量删除学校信息 */
export const removeBatch = params => {
  return request.request({
    url: Api.removeBatch,
    params,
    method: 'DELETE'
  })
}

/** 查询学校信息详情 */
export const page = params => {
  return request.request({
    url: Api.page,
    params,
    method: 'GET'
  })
}

/** 验证学校的名称 */
export const getSchoolEnName = params => {
  return request.request({
    url: Api.getSchoolEnName,
    params,
    method: 'GET'
  })
}

/** 新增课程基本信息 */
export const save = data => {
  return request.request({
    url: Api.save,
    data,
    method: 'POST'
  })
}

/** 查询学校信息详情 */
export const selectById = params => {
  return request.request({
    url: Api.selectById,
    params,
    method: 'GET'
  })
}

export const update = data => {
  return request.request({
    url: Api.update,
    data,
    method: 'PUT'
  })
}

export const getCountry = data => {
  return request.request({
    url: Api.country,
    data,
    method: 'GET'
  })
}

/** 文件导入 */
export const imports = data => {
  return request.request({
    url: Api.imports,
    data,
    method: 'post'
  })
}
export const templateUrl = Api.template

export const updateFollowUpRecord = data => {
  return request.request({
    url: Api.updateFollowUpRecord,
    data:data,
    method: 'POST'
  })
}
export const putFollowUpRecord = data => {
  return request.request({
    url: Api.updateFollowUpRecord,
    data:data,
    method: 'PUT'
  })
}
export const delFollowUpRecord = data => {
  return request.request({
    url: Api.delFollowUpRecord,
    data,
    method: 'PUT'
  })
}
// 批量修改负责人
export const updateUser = data => {
  return request.request({
    url: Api.updateUser,
    data:data,
    method: 'PUT'
  })
}
